﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>高铁客户端首页</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <meta http-equiv="X-UA-Compatible" content="IE=9"/>

    <meta name="keywords" content="railway,Service,RailwayService"/>
    <meta name="description" content="高铁客户端,高铁客户服务,高铁客户服务首页"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <!-- basic styles -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="assets/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="assets/css/validationEngine.jquery.css"/>

    <!--[if IE 7]>
    <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css"/>
    <![endif]-->
    <!-- page specific plugin styles -->
    <!-- fonts -->
    <!--
		<link rel="stylesheet" href="http://fonts.useso.com/css?family=Open+Sans:400,300" />
		-->
    <!-- ace styles -->
    <link rel="stylesheet" href="assets/css/ace.min.css"/>
    <link rel="stylesheet" href="assets/css/ace-rtl.min.css"/>
    <link rel="stylesheet" href="assets/css/ace-skins.min.css"/>
    <!--[if lte IE 8]>
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css" media="screen"/>
    <link rel="stylesheet" href="assets/css/ace-ie.min.css"/>

    <script type="text/javascript" src="script/ie.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="assets/js/jquery.placeholder.js"></script>
    <![endif]-->
    <!-- inline styles related to this page -->
    <!-- ace settings handler -->
    <script src="assets/js/ace-extra.min.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="assets/js/html5shiv.js"></script>
    <script src="assets/js/respond.min.js"></script>
    <![endif]-->
    <!-- Bootstrap-Table -->
    <link rel="stylesheet" href="assets/css/bootstrap-table.min.css"/>
    <link rel="stylesheet" href="assets/css/styles.css"/>
    <style type="text/css">
        .modal[isbindmv] .modal-header {
            cursor: move;
        }
    </style>
    <script type="text/javascript">
        var btModalMoveEx = function () {
            function moveEx($this) {
                var $head = $this.find(".modal-header"),
                        $dialog = $this.find(".modal-dialog");
                var move = {
                    isMove: false,
                    left: 0,
                    top: 0
                };
                $this.on("mousemove", function (e) {
                    if (!move.isMove) return;
                    $dialog.offset({
                        top: e.pageY - move.top,
                        left: e.pageX - move.left
                    });
                }).on("mouseup", function () {
                    move.isMove = false;
                });
                $head.on("mousedown", function (e) {
                    move.isMove = true;
                    var offset = $dialog.offset();
                    move.left = e.pageX - offset.left;
                    move.top = e.pageY - offset.top;
                });
            }

            var old = $.fn.modal;
            $.fn.modal = function (o, _r) {
                var $this = $(this);
                // 标识 是否已经绑定过移动事件了.用于防止重复绑定
                if (!$this.attr("isbindmv")) {
                    $this.attr("isbindmv", "1");
                    moveEx($this);
                }
                return old.call(this, o, _r);
            };
        };
    </script>
    <script>
        function loadPage(url) {
            $("#main-content").load("." + url + "?time=" + (new Date().getTime()));
        }

        function logout() {
            if (confirm("确认退出系统？") == true) {
                $.ajax({
                    type: "POST",
                    url: '../common/sessionLogout',
                    dataType: 'json',
                    //data:$('#resetPasswordFormId').serialize(),// 你的formid
                    error: function (request) {
                        alert(request);
                        //$(".overlay").remove();
                        //alert("Connection error");
                    },
                    success: function (rs) {
                        if (rs.success) {
                            window.location.href = "./login.html";
                        } else {
                            alert(rs.message);
                            //$(".overlay").remove();
                        }
                    }
                });
            }
        }

        function getLoginUserName() {
            $.ajax({
                type: "POST",
                url: '../admin/adminGetUserName',
                dataType: 'json',
                error: function (request) {
                    //alert(request);
                },
                success: function (rs) {
                    if (rs.success) {
                        $("#user-info-name").after(rs.data);
                    }
                }
            });
        }

        function resetPassword() {

            $(this).overlay({
                closeOnClick: true
            });
            var $that = $(this);
            //var  $pass = $that.find('input[name="newPassword"]').val();
            // var  $conPass = $that.find('input[name="repeatNewPassword"]').val();
            var oldPassword = $("#oldPassword").val();
            var pass = $("#newPassword").val();
            var conPass = $("#repeatNewPassword").val();

            if (conPass === '') {
                alert("确认密码为空，请输入");
                return false;
            }
            ;
            if (pass != conPass) {
                alert("两次输入的密码不一致，请重新输入");
                return false;
            }
            ;
            $.ajax({
                type: "POST",
                url: '../admin/resetPassWord',
                dataType: 'json',
                data: $('#resetPasswordFormId').serialize(), // 你的formid
                error: function (request) {
                    alert(request);
                    $(".overlay").remove();
                    //alert("Connection error");
                },
                success: function (rs) {
                    if (rs.success) {
                        alert("修改成功");
                        $("#updatesecretModal").modal('hide');
                        window.location.href = "index.html";
                    } else {
                        alert(rs.message);
                        $(".overlay").remove();
                        //window.location.href="index.html";
                    }
                }
            });
        }
    </script>
</head>

<body>
<div class="navbar navbar-default" id="navbar"
     style="background-image: url(assets/images/index.png); width: 100%;background-repeat-x: no-repeat;">
    <script type="text/javascript">
        try {
            ace.settings.check('navbar', 'fixed')
        } catch (e) {
        }
    </script>
    <div class="navbar-container" id="navbar-container">
        <div class="navbar-header pull-left">
            <a href="#" class="navbar-brand">
                <small>
                    <i class="iconLogo">&#xe601;</i>
                    高铁服务后台管理系统
                </small>
            </a>
            <!-- /.brand -->
        </div>
        <!-- /.navbar-header -->
        <div class="navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                <li class="light-blue">
                    <img class="nav-user-photo" src="assets/avatars/user.jpg" alt="Admin's Photo"/>
                    <span class="user-info">
						<small id="user-info-name">欢迎光临</small>
					</span>
                </li>
                <li class="light-blue" style="border-left: 0; margin-left: -10px;">
                    <a href="#" data-toggle="modal" data-target="#updatesecretModal">【修改密码】
                    </a>
                </li>
                <li class="light-blue" style="margin-right: -20px;">
                    <a href="#" onclick="logout()">
                        <i class="iconfont-close">&#xe613;</i>
                    </a>
                </li>
            </ul>
            <!-- /.ace-nav -->
        </div>
        <!-- /.navbar-header -->
    </div>
    <!-- /.container -->
</div>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>
    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>
        <div class="sidebar" id="sidebar">
            <script type="text/javascript">
                try {
                    ace.settings.check('sidebar', 'fixed')
                } catch (e) {
                }
            </script>
            <ul class="nav nav-list">
                <li class="active">
                    <!--<a href="#" onclick="javascript:loadPage('console.html');return false;">-->
                    <!--&lt;!&ndash;<i class="icon-dashboard"></i>&ndash;&gt;-->
                    <!--&lt;!&ndash;<span class="menu-text"> 控制台 </span>&ndash;&gt;-->
                    <!--</a>-->
                </li>
            </ul>
            <!-- /.nav-list -->
            <div class="sidebar-collapse" id="sidebar-collapse">
                <i class="icon-double-angle-left" data-icon1="icon-double-angle-left"
                   data-icon2="icon-double-angle-right"></i>
            </div>
            <script type="text/javascript">
                try {
                    ace.settings.check('sidebar', 'collapsed')
                } catch (e) {
                }
            </script>
        </div>
        <div id="main-content" class="main-content">
        </div>
        <!-- /.main-content -->
        <div class="ace-settings-container" id="ace-settings-container">
            <!-- <div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
                    <i class="icon-cog bigger-150"></i>
                </div> -->
            <div class="ace-settings-box" id="ace-settings-box">
                <div>
                    <div class="pull-left">
                        <select id="skin-colorpicker" class="hide">
                            <option data-skin="default" value="#438EB9">#438EB9</option>
                            <option data-skin="skin-1" value="#222A2D">#222A2D</option>
                            <option data-skin="skin-2" value="#C6487E">#C6487E</option>
                            <option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
                        </select>
                    </div>
                    <span>&nbsp; 选择皮肤</span>
                </div>
                <div>
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar"/>
                    <label class="lbl" for="ace-settings-navbar"> 固定导航条</label>
                </div>
                <div>
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar"/>
                    <label class="lbl" for="ace-settings-sidebar"> 固定滑动条</label>
                </div>
                <div>
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs"/>
                    <label class="lbl" for="ace-settings-breadcrumbs">固定面包屑</label>
                </div>
                <div>
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl"/>
                    <label class="lbl" for="ace-settings-rtl">切换到左边</label>
                </div>
                <div>
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container"/>
                    <label class="lbl" for="ace-settings-add-container">
                        切换窄屏
                        <b></b>
                    </label>
                </div>
            </div>
        </div>
        <!-- /#ace-settings-container -->
    </div>
    <!-- /.main-container-inner -->
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div>
<!-- /.main-container -->
<!-- 重置密码的modal start-->
<div class="modal fade" id="updatesecretModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div id="modalDialog" class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel" style="text-align: center;">重置密码</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="resetPasswordFormId"
                      style="border-image:none;padding: 30px;margin: auto;" role="form" method="get">
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="oldPassword">旧密码</label>
                        <div class="col-sm-5">
                            <input type="password" class="form-control" id="oldPassword" name="oldPassword"
                                   placeholder="password">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="newPassword">新密码</label>
                        <div class="col-sm-5">
                            <input type="password" class="form-control" id="newPassword" name="newPassword"
                                   placeholder="password" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="repeatNewPassword">确认密码</label>
                        <div class="col-sm-5">
                            <input type="password" class="form-control " id="repeatNewPassword" name="repeatNewPassword"
                                   placeholder="password" required>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" onclick="resetPassword();" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!-- 重置密码的modal end-->
<!-- basic scripts -->
<!--[if !IE]> -->
<script src="assets/js/jquery-2.0.3.min.js"></script>
<!-- <![endif]-->
<!--[if IE]>
<script src="assets/js/jquery-1.10.2.min.js"></script>
<![endif]-->
<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document
            .write("<script src='assets/js/jquery-2.0.3.min.js'>" + "<" + "script>");
</script>
<!-- <![endif]-->
<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>" + "<" + "script>");
</script>
<![endif]-->
<script src="assets/js/jquery.overlay.min.js"></script>
<script type="text/javascript">
//    if ("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>" + "<" + "script>");
</script>
<script src="assets/js/bootstrap.min.js"></script>
<!--<script src="assets/js/bootstrap.js"></script>-->
<script src="assets/js/bootstrap-table/bootstrap-table.min.js"></script>
<script src="assets/js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<script src="assets/js/typeahead-bs2.min.js"></script>
<!-- page specific plugin scripts -->
<!--[if lte IE 8]>
<script src="assets/js/excanvas.min.js"></script>
<![endif]-->
<script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script>
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
<script src="assets/js/jquery.slimscroll.min.js"></script>
<script src="assets/js/jquery.easy-pie-chart.min.js"></script>
<script src="assets/js/jquery.sparkline.min.js"></script>
<script src="assets/js/flot/jquery.flot.min.js"></script>
<script src="assets/js/flot/jquery.flot.pie.min.js"></script>
<script src="assets/js/flot/jquery.flot.resize.min.js"></script>
<script src="assets/js/form.js"></script>
<script src="assets/js/jquery.validate.js"></script>
<!-- ace scripts -->
<script src="assets/js/ace-elements.min.js"></script>
<script src="assets/js/ace.min.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    //$('#updatesecretModal').modal({backdrop: 'static'});

    // 使modal在window居中，并且可以拖动
    $(document).on("shown.bs.modal", ".modal", function () {
        $(this).css('display', 'block');
        var $dialog = $(this).find('.modal-dialog'),
                modalHeight = $(window).height() / 2 - $dialog.height() / 2;
//                modalWidth = $(window).width() / 2 - $dialog.width() / 2;

        $dialog.css({
            'margin-top': modalHeight,
            'left': 0
        });
//
//        $(this).draggable({
//            handle: ".modal-header" // 只能点击头部拖动
//        });
//        $(this).css("overflow", "hidden"); // 防止出现滚动条，出现的话，你会把滚动条一起拖着走的
    });
</script>
<script type="text/javascript">
    $(document).ready(function () {
//
//        $("#modalDialog").draggable(); //为模态对话框添加拖拽
//        $("#myModal").css("overflow", "hidden"); //禁止模态对话框的半透明背景滚动

        getLoginUserName();

    });
</script>
<script>
    $(document).ready(function () {
        getAdminMenu();
    });

    function getAdminMenu() {
        $.ajax({
            type: "POST",
            url: "../admin/getAdminMenu",
            data: "",
            dataType: 'json',
            beforeSend: function () {
            },
            success: function (data) {
                if (data.code == 1) {
                    var json = data;
                    var this_data = eval(json.data);
//                    var icon = ["&#xe61f;","&#xe62d;", "&#xe603;", "&#xe639;", "&#xe614;", "&#xe60b;", "&#xe630;", "&#xe606;", "&#xe620;", "&#xe640;"];
                    if (this_data.length > 0) {

                        $("#sidebar .nav").empty();

                        for (i = 0; i < this_data.length; i++) {

                            if (this_data[i].subMenus != null) {
                                var tmpStr = "" +
                                        "<li>" +
                                        "<a href='#' class='dropdown-toggle'>" +
                                        "<i class='icon icon" + i + "'>" + this_data[i].icon + "</i>" +
                                        "<span class='menu-text'>" + this_data[i].name + "</span>" +
                                        "<b class='arrow icon-angle-down'></b>" +
                                        "</a>" +
                                        "<ul class='submenu'>";
                                for (j = 0; j < this_data[i].subMenus.length; j++) {
                                    if (this_data[i].subMenus[j].menuUrl != null) {
                                        this_data[i].subMenus[j].menuUrl = this_data[i].subMenus[j].menuUrl.replace(new RegExp("\\\\", "gm"), "\\\\");
                                    }
                                    tmpStr = tmpStr + '<li><a href="#" onclick="javascript:loadPage(&quot;' + this_data[i].subMenus[j].menuUrl + '&quot;);return false;">' + this_data[i].subMenus[j].name + '</a></li>';
                                }
                                tmpStr = tmpStr + "</ul></li>";
                                $("#sidebar .nav").append(tmpStr);
                            } else {
                                if (this_data[i].menuUrl == "") {
                                    $("#sidebar .nav").append('' +
                                            '<li>' +
                                            '<a href="#" class="dropdown-toggle">' +
                                            "<i class='icon " + i + "'>" + this_data[i].icon + "</i>" +
                                            '<span class="menu-text">' + this_data[i].name + '</span>' +
                                            '</a>' +
                                            '</li>');
                                } else {
                                    //this_data[i].menuUrl=this_data[i].menuUrl.replaceAll('\\','\\\\');
                                    if (this_data[i].menuUrl != null) {
                                        this_data[i].menuUrl = this_data[i].menuUrl.replace(new RegExp("\\\\", "gm"), "\\\\");
                                    }
                                    $("#sidebar .nav").append('' +
                                            '<li>' +
                                            '<a href="#" onclick="javascript:loadPage(&quot;' + this_data[i].menuUrl + '&quot;);return false;" class="dropdown-toggle">' +
                                            "<i class='icon " + i + "'>" + this_data[i].icon + "</i>" +
                                            '<span class="menu-text">' + this_data[i].name + '</span>' +
                                            '</a>' +
                                            '</li>');
                                }

                            }

                        }
                    } else {
                        alert("没有菜单数据！");
                    }
                } else {
                    window.location.href = "./login.html";

                }
            }
        });
    }
</script>
<script src="script/utils.js" type="text/javascript"></script>
<div style="display:none"></div>
<script type="text/javascript">
    $('.icon-double-angle-right').hide
</script>
</body>

</html>
